
from functools import cmp_to_key

import operator
lt1=list(map(str,input().split()))
lt1.sort(key=cmp_to_key(lambda x,y:operator.lt((x+y),(y+x))))
print(''.join(lt1))
print(operator.lt('345','456'))
